package vno.sci.window
{	
	import flash.display.Sprite;
	
	import org.aswing.ASColor;
	import org.aswing.ASFont;
	import org.aswing.AsWingManager;
	import org.aswing.JLabel;

	public class OLabel extends Sprite
	{
		private var _font:ASFont;
		private var _label:JLabel;
		
		private var _alpha:Number = 0.8;
		public function OLabel(text:String = "")
		{
			super();
			AsWingManager.initAsStandard(this);
			_label = new JLabel(text);
			
			_label.setSizeWH(50,12);
			_label.setSize(_label.getPreferredSize());
			
			this.addChild(_label);
		}
		
		public function set text(t:String):void
		{
			_label.setText(t);
			_label.setSize(_label.getPreferredSize());
			_label.setForeground(ASColor.WHITE);
			
			this.graphics.clear();
			this.graphics.beginFill(0x801DAE,_alpha);
			this.graphics.drawRoundRect(0,0,_label.getPreferredWidth(),_label.getPreferredHeight(),10);
			this.graphics.endFill();
		}
		public function set font(f:ASFont):void
		{
			_font = f;
			_label.setFont(f);
		}
		public function get label():JLabel
		{
			return _label;
		}
	}
}